<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>하이퍼 링크</title>
<link rel="stylesheet" type="text/css" href="dialog.css" />
<script type="text/javascript">
function UpdateProtocol()
{
  var selectedItem        = document.set.protocol.selectedIndex;
  var selectedItemValue   = document.set.protocol.options[selectedItem].value;
  var selectedItemText    = document.set.protocol.options[selectedItem].text;
  var inputtedText        = document.set.link_value.value;

  var protocol = inputtedText.split(":");

  if (protocol[1]) {
    var datum = protocol[1].replace(/^\/\//, "");
    datum = datum.replace(/\\/, "");
    datum = datum.replace(/^\//, "");
  }
  else {
    if(inputtedText.indexOf(":") > 0)
      var datum = "";
    else {
      var datum = protocol[0];
      datum = protocol[0].replace(/^\/\/\//, "//");
    }
  }

  document.set.link_value.value = selectedItemValue + datum;
  document.set.link_value.focus();
}
var oEditor = parent.chutil.oname;
function returnSelected()
{
  var text;
  var target = null;
  var title = null;

  if (document.set.link_value.value != "") {
    text = document.set.link_value.value;
  }
  else {
    alert("링크 URL을 입력하여 주십시오.");
    return false;
  }

  if (document.set.target.value != "") {
    target = document.set.target.value;
  }

  if (document.set.title.value != "") {
    title = document.set.title.value;
  }

  eval("parent."+oEditor).hyperLink(text, target, title);
  popupClose();
}

function popupClose() {
    eval('parent.'+oEditor).popupWinClose();
}
</script>
</head>
<body>
<form name="set">
<input type="hidden" value="" name="SelTxt" />
<table cellpadding="0" cellspacing="0" border="0" width="100%">
  <tr>
    <td>
      <fieldset>
      <table border="0" cellspacing="4">
        <tr>
          <td align="right" width="40"><span class="normal">유형:</span>
          </td>
          <td>
            <select name="protocol" onchange="UpdateProtocol()">
            <option value="http://" selected="selected" />http
            <option value="https://" />https
            <option value="mailto:" />mailto
            <option value="file://" />file
            <option value="ftp://" />ftp
            <option value="gopher://" />gopher
            <option value="news:" />news
            <option value="telnet:" />telnet
            <option value="wias:" />wias
            <option value="javascript:" />javascript
            </select>
          </td>
          <td align="right"><span class="normal">타겟:</span>
          </td>
          <td>
            <select name="target">
              <option value="" />없음
              <option value="_self" />_self
              <option value="_blank" selected="selected" />_blank
              <option value="_parent" />_parent
              <option value="_top" />_top
            </select>
          </td>
        </tr>
        <tr>
          <td align="right"><span class="normal">URL:</span>
          </td>
          <td colspan="3">
            <input type="text" name="link_value" value="http://" size="50" />
          </td>
        </tr>
        <tr>
          <td align="right"><span class="normal">타이틀:</span>
          </td>
          <td colspan="3">
            <input type="text" name="title" value="" size="50" />
          </td>
        </tr>
      </table>
      </fieldset>
    </td>
  </tr>
</table>
</form>
<div class="spacer"></div>
<div align="center">
<button class="button" onclick="returnSelected()">확인</button>&#160;<button class="button" onclick="popupClose()">취소</button>
</div>
</body>
</html>
